<?php
/**
 * @name noFrame
 * @version 1.1.1
 * @author 殷福渊 <yii153@163.com>
 */

@$path_info = $_SERVER['PATH_INFO'] or

$path_info = current(array_keys($_GET)) or

die(json_encode(array('success'=>false,'message'=>'ERR_PARAMETER_NO_REQUEST')));

isset($_GET[$path_info]) and array_shift($_GET);

$request = explode('/',$path_info);

$method = array_pop($request);

$class = implode('\\',$request) or

die(json_encode(array('success'=>false,'message'=>'ERR_PARAMETER_ERROR')));

define("BASEDIR", __DIR__);

spl_autoload_register(function($class){(@include(BASEDIR.'/'.str_replace('\\', '/', $class).'.class.php')) or

die(json_encode(array('success'=>false,'message'=>'ERR_FILE_NOT_FOUND')));});

$object = new $class();

method_exists($object,$method) or

die(json_encode(array('success'=>false,'message'=>'ERR_METHOD_NOT_FOUND')));

isset($_SESSION) or session_start();

$object->$method();

?>
